package com.openbravo.beans;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateUtils
{
  public static Date getToday()
  {
    return getToday(new Date());
  }

  public static Date getToday(Date paramDate)
  {
    GregorianCalendar localGregorianCalendar1 = new GregorianCalendar();
    localGregorianCalendar1.setTime(paramDate);
    GregorianCalendar localGregorianCalendar2 = new GregorianCalendar(localGregorianCalendar1.get(1), localGregorianCalendar1.get(2), localGregorianCalendar1.get(5));
    return localGregorianCalendar2.getTime();
  }

  public static Date getTodayMinutes()
  {
    return getTodayMinutes(new Date());
  }

  public static Date getTodayMinutes(Date paramDate)
  {
    GregorianCalendar localGregorianCalendar1 = new GregorianCalendar();
    localGregorianCalendar1.setTime(paramDate);
    GregorianCalendar localGregorianCalendar2 = new GregorianCalendar(localGregorianCalendar1.get(1), localGregorianCalendar1.get(2), localGregorianCalendar1.get(5), localGregorianCalendar1.get(11), localGregorianCalendar1.get(12));
    return localGregorianCalendar2.getTime();
  }

  public static Date getTodayHours(Date paramDate)
  {
    Calendar localCalendar1 = Calendar.getInstance();
    localCalendar1.setTime(paramDate);
    Calendar localCalendar2 = Calendar.getInstance();
    localCalendar2.clear();
    localCalendar2.set(localCalendar1.get(1), localCalendar1.get(2), localCalendar1.get(5), localCalendar1.get(11), 0, 0);
    return localCalendar2.getTime();
  }

  public static Date getDate(Date paramDate1, Date paramDate2)
  {
    Calendar localCalendar1 = Calendar.getInstance();
    localCalendar1.setTime(paramDate1);
    Calendar localCalendar2 = Calendar.getInstance();
    localCalendar2.setTime(paramDate2);
    Calendar localCalendar3 = Calendar.getInstance();
    localCalendar3.clear();
    localCalendar3.set(localCalendar1.get(1), localCalendar1.get(2), localCalendar1.get(5), localCalendar2.get(11), localCalendar2.get(12), localCalendar2.get(13));
    return localCalendar3.getTime();
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.beans.DateUtils
 * JD-Core Version:    0.6.0
 */